package com.xlh.dao.courseTest.helper;

import com.xlh.dao.courseTest.PracticeMapper;
import com.xlh.pojo.courseTest.Practice;
import com.xlh.pojo.courseTest.PracticeExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author cfz
 */
@Repository
public class PracticeMapperHelper {

    @Autowired
    private PracticeMapper practiceMapper;


    public List<Practice> findPracticeByChapter(Long chapterId, List<Long> userClassIds){

        PracticeExample practiceCondition = new PracticeExample();
        practiceCondition.createCriteria().andChapterIdEqualTo(chapterId).andStudentIdIn(userClassIds).andDelMarkEqualTo(false);
        List<Practice> practices = practiceMapper.selectByExample(practiceCondition);
        return  practices;
    }




}
